import requests

from config import BASE_URL, HEADERS


class CpBoysApi:
    # 查询员工
    @classmethod
    def boys_query(cls,data):
        url = BASE_URL + "boys/"+data
        resp = requests.get(url=url, headers=HEADERS)
        return resp

    # 增加
    @classmethod
    def boys_add(cls,data):
        url = BASE_URL + "boys/"
        resp = requests.post(url=url, headers=HEADERS, json=data)
        return resp
    # 修改
    @classmethod
    def boys_update(cls,data):
        url = BASE_URL + "boys/"
        resp = requests.put(url=url, headers=HEADERS, json=data)
        return resp
    # 删除
    @classmethod
    def boys_del(cls,data):
        url = BASE_URL + "boys/"
        resp = requests.delete(url=url, headers=HEADERS, data=data)
        return resp


